package cnhy.salary.domain.dto;

import com.ruoyi.common.utils.DictUtils;
import lombok.var;

import java.util.Objects;

public class WageDictCfg {
    {
        overtime = Double.parseDouble(DictUtils.getDictValue("pay_wage_cfg", "加班费"));
        workingAgeWage = Double.parseDouble(DictUtils.getDictValue("pay_wage_cfg", "工龄每周期工资")); //工龄每周期工资
        workingAgeCycle = Double.parseDouble(DictUtils.getDictValue("pay_wage_cfg", "工龄每周期月数"));    //工龄周期月
        fullWorkWage = Double.parseDouble(DictUtils.getDictValue("pay_wage_cfg", "满勤奖"));      //满勤奖
        openApprovalLeaveRecord= Objects.equals(DictUtils.getDictValue("pay_wage_cfg", "请假审批"), "1");
        openApprovalPostTransfer= Objects.equals(DictUtils.getDictValue("pay_wage_cfg", "换岗审批"), "1");
        openApprovalPostTransfer2= Objects.equals(DictUtils.getDictValue("pay_wage_cfg", "换岗审批"), "1");
    }
      static WageDictCfg defCfg;
    public static WageDictCfg cfg(){
        if(defCfg==null)
            defCfg=new WageDictCfg();
        return defCfg;
    }
    public final double overtime;
    public final double workingAgeWage;
    public final double workingAgeCycle;
    public final double fullWorkWage;
    public final boolean openApprovalLeaveRecord;
    public final boolean openApprovalPostTransfer;
    public final boolean openApprovalPostTransfer2;
}
